<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-mpFinancialSetting-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">：</label>
				<div class="col-sm-8">
					<input id="withdrawalPassword" name="withdrawalPassword" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">：</label>
				<div class="col-sm-8">
					<input id="googleSecret" name="googleSecret" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">代付规则（1.渠道优先级2.渠道余额大小）：</label>
				<div class="col-sm-8">
					<input id="mchWithdrawalRule" name="mchWithdrawalRule" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">代付内扣：</label>
				<div class="col-sm-8">
					<div class="onoffswitch">
						<input type="checkbox" th:checked="false" class="onoffswitch-checkbox" id="withdrawalInner" name="withdrawalInner">
						<label class="onoffswitch-label" for="withdrawalInner">
							<span class="onoffswitch-inner"></span>
							<span class="onoffswitch-switch"></span>
						</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">代付审核：</label>
				<div class="col-sm-8">
					<div class="onoffswitch">
						<input type="checkbox" th:checked="false" class="onoffswitch-checkbox" id="withdrawalAudit" name="withdrawalAudit">
						<label class="onoffswitch-label" for="withdrawalAudit">
							<span class="onoffswitch-inner"></span>
							<span class="onoffswitch-switch"></span>
						</label>
					</div>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "financial/mpFinancialSetting"
		$("#form-mpFinancialSetting-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
                var data = $('#form-mpFinancialSetting-add').serializeArray();
                var withdrawalInner = $("input[id='withdrawalInner']").is(':checked') == true ? 0 : 1;
                if (withdrawalInner != 0){
                    data.push({"name": "withdrawalInner", "value": withdrawalInner});
                } else {
                    data[3].value = withdrawalInner;
                }
                $.operate.save(prefix + "/add", data);
	        }
	    }
	</script>
</body>
</html>
